<template>

	<div>
		<header class="navigation">
			<div @click="retreat"><img src="../assets/rightbut.png"></div>
			<div>帮助中心</div>
			<div></div>
		</header>

		<div v-for='item in helplist' v-if='item.title == val'>
			<div class="title">{{item.title}}</div>
			<div class="content">
				{{item.content}}
			</div>
		</div>
	</div>

</template>

<script>
	import { BaseUrl } from '../Baseurl/common.js';
	import { Toast } from 'mint-ui';
	export default {
		data() {
			return {
				help: '',
				helplist: [],
				val: '',
			}
		},
		created() {
			var help = this.$route.query.help;
			this.help = unescape(help);
			var val = this.$route.query.val;
			this.val = unescape(val);
			var url = BaseUrl + 'users/helper/list?code=' + this.help;
			this.$http.post(url).then(res => {
				if(res.data.code == '10000') {
					this.helplist = res.data.data;
				} else {
					Toast({
						message: res.data.mag,
						position: 'middle',
						duration: 3000
					})
				}
			}).catch(error => {
				Toast({
					message: "网络异常",
					position: 'middle',
					duration: 3000
				})
			})
		},
		methods: {
			//导航退后
			retreat: function() {
				window.history.go(-1);
			},
		}
	}
</script>

<style scoped="scoped">
	.navigation {
		height: 1rem;
		background: #fff;
		display: flex;
		align-items: center;
		justify-content: space-between;
		border-bottom: 1px solid #E3E3E3;
		padding: 0 0.25rem;
		color: #323232;
		font-size: 0.36rem;
	}
	
	.navigation img {
		width: 0.2rem;
		height: 0.36rem;
		display: block;
	}
	
	.title {
		border-top: 0.1rem solid #F2F2F2;
		font-size: 0.4rem;
		color: #323232;
		border-bottom: 1px solid #E3E3E3;
		padding: 0.2rem 0.25rem;
	}
	
	.content {
		padding: 0.2rem 0.25rem;
		font-size: 0.26rem;
		color: #323232;
	}
</style>